#ifndef _keylayout_h_
#define _keylayout_h_

#include "keyboard.h"

// Explicacion:
//  El primer corchete puede valer 0 o 1 dependiendo
//  del enum kLayouT. Si es cero va a la parte de arriba
//  que corresponde al teclado en ingles, si es uno va a la
//  parte de abajo que corresponde al teclado en espanol.
//  El segundo corchete indica si fue apretado el shift o no
//  si vale cero es que no fue apretado, 1 en caso contrario.
//  El tercer corchete corresponde a las teclas del teclado
//  valga la redundancia
//

int key_layouts[][2][128] = {
	{{
		/*0      1    2     3     4     5     6     7     8     9*/
/*00*/	  NONE,   ESC,  '1',  '2',  '3',  '4',  '5',  '6',  '7',  '8',
/*01*/	 '9',  '0',  '-',  '=', '\b', '\t',  'q',  'w',  'e',  'r',
/*02*/	 't',  'y',  'u',  'i',  'o',  'p',  '[',  ']', '\n',  L_CTRL,
/*03*/	 'a',  's',  'd',  'f',  'g',  'h',  'j',  'k',  'l',  ';',
/*04*/	'\'',  '`',  L_SHIFT, '\\',  'z',  'x',  'c',  'v',  'b',  'n',
/*05*/	 'm',  ',',  '.',  '/',  R_SHIFT,  '*',  L_ALT,  ' ',  CPS_LCK,  F01,
/*06*/	 F02,  F03,  F04,  F05,  F06,  F07,  F08,  F09,  F10,  NUM_LCK,
/*07*/	 SCR_LCK,  HOME,  UP,  PG_UP,  '-',  LEFT,  CENTER,  RIGHT,  '+',  END,
/*08*/	 DOWN,  PG_DW,  INSERT,  DELETE,  '/', '\n',  NONE,  NONE,  NONE,  NONE,
/*09*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*10*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*11*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*12*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE
	},{
	/*0      1    2     3     4     5     6     7     8     9*/
/*00*/	 NONE,  ESC,  '!',  '@',  '#',  '$',  '%',  '^',  '&',  '*',
/*01*/	 '(',  ')',  '_',  '+', '\b', '\t',  'Q',  'W',  'E',  'R',
/*02*/	 'T',  'Y',  'U',  'I',  'O',  'P',  '{',  '}', '\n',  L_CTRL,
/*03*/	 'A',  'S',  'D',  'F',  'G',  'H',  'J',  'K',  'L',  ':',
/*04*/	'\"',  '~',  L_SHIFT,  '~',  'Z',  'X',  'C',  'V',  'B',  'N',
/*05*/	 'M',  '<',  '>', '\?',  R_SHIFT,  '*',  L_ALT,  ' ',  CPS_LCK,  F01,
/*06*/	 F02,  F03,  F04,  F05,  F06,  F07,  F08,  F09,  F10,  NUM_LCK,
/*07*/	 SCR_LCK,  HOME,  UP,  PG_UP,  '-',  LEFT,  CENTER,  RIGHT,  '+',  END,
/*08*/	 DOWN,  PG_DW,  INSERT,  DELETE,  '/', '\n',  NONE,  NONE,  NONE,  NONE,
/*09*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*10*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*11*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*12*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE
	}},


        {{
 	/*0      1    2     3     4     5     6     7     8     9*/
/*00*/	 NONE,  ESC,  '1',  '2',  '3',  '4',  '5',  '6',  '7',  '8',
/*01*/	 '9',  '0', '\'',  173, '\b', '\t',  'q',  'w',  'e',  'r',
/*02*/	 't',  'y',  'u',  'i',  'o',  'p',  '`',  '+', '\n',  L_CTRL,
/*03*/	 'a',  's',  'd',  'f',  'g',  'h',  'j',  'k',  'l',  164,
/*04*/	 '{', '|',  L_SHIFT, '}',  'z',  'x',  'c',  'v',  'b',  'n',
/*05*/	 'm',  ',',  '.',  '-',  R_SHIFT,  '*',  L_ALT,  ' ',  CPS_LCK,  F01,
/*06*/	 F02,  F03,  F04,  F05,  F06,  F07,  F08,  F09,  F10,  NUM_LCK,
/*07*/	 SCR_LCK,  HOME,  UP,  PG_UP,  '-',  LEFT,  CENTER,  RIGHT,  '+',  END,
/*08*/	 DOWN,  PG_DW,  INSERT,  DELETE,  '/', '\n',  '<',  NONE,  NONE,  NONE,
/*09*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*10*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*11*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*12*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE

	},{			// Layout con shift
	/*0      1    2     3     4     5     6     7     8     9*/
/*00*/	 NONE,  ESC,  '!', '\"',  '#',  '$',  '%',  '&',  '/',  '(',
/*01*/	 ')',  '=', '\?',  168, '\b', '\t',  'Q',  'W',  'E',  'R',
/*02*/	 'T',  'Y',  'U',  'I',  'O',  'P',  DIERESIS,  '*', '\n',  L_CTRL,
/*03*/	 'A',  'S',  'D',  'F',  'G',  'H',  'J',  'K',  'L',  165,
/*04*/	 '[',  '|',  L_SHIFT,  ']',  'Z',  'X',  'C',  'V',  'B',  'N',
/*05*/	 'M',  ';',  ':',  '_',  R_SHIFT,  '*',  L_ALT,  ' ',  CPS_LCK,  F01,
/*06*/	 F02,  F03,  F04,  F05,  F06,  F07,  F08,  F09,  F10,  NUM_LCK,
/*07*/	 SCR_LCK,  HOME,  UP,  PG_UP,  '-',  LEFT,  CENTER,  RIGHT,  '+',  END,
/*08*/	 DOWN,  PG_DW,  INSERT,  DELETE,  '/', '\n',  '>',  NONE,  NONE,  NONE,
/*09*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*10*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*11*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,
/*12*/	 NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE,  NONE
	}}

	};

int num_keyboard[] =
{
  //HOME UP  PG_UP  LEFT  CENTER   RIGHT   END   DOWN  PG_DW  INSERT  DELETE
    '7', '8',   '9',  '4',    '5',   '6', '1',  '2',   '3',    '0',    '.'
};

#endif

